package convert;

import java.util.ArrayList;
import java.util.List;

public class CollectionToArrayDemo {

    public static void main(String[] args) {
        List<String> list = new ArrayList<String>();
        list.add("北京");
        list.add("上海");
        list.add("广州");
        list.add("深圳");

        String[] citys =  list.toArray(new String[]{});
        for(String c: citys){
            System.out.println(c);
        }
    }
}
